package com.dz.service;

import com.dz.bean.guanli;

import java.util.Vector;

public class DL {
    private DL(){
        this.guanliDl= new Vector<guanli>();
    }

    private static DL dl;

    public static synchronized DL getDl(){
        if(dl==null){
            dl=new DL();
        }
        return dl;
    }

    private Vector<guanli> guanliDl;


    public void adduser(guanli g1){
        this.guanliDl.add(g1);
    }

    public Boolean wo(String name){
        guanli g1 =new guanli();
        g1.setAname(name);
        Boolean b=true;
        for (int i = 0; i < this.guanliDl.size(); i++) {
            if(this.guanliDl.get(i).equals(g1)){
                b=false;
                break;
            }

        }

        if(b){
            return true;
        }else {
            return false;
        }
    }


}
